package com.sgcc;

import com.ribbon.MyRule;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.netflix.feign.EnableFeignClients;
import org.springframework.cloud.netflix.ribbon.RibbonClient;

/**
 * @BelongsProject: springcloud
 * @BelongsPackage: com.sgcc
 * @Author: LiMengshuai
 * @CreateTime: 2019-07-24 10:38
 * @Description: ${Description}
 */
@SpringBootApplication
@EnableEurekaClient
@EnableFeignClients
@EnableCircuitBreaker
@RibbonClient(name="service-provider",configuration = MyRule.class)//自定义负载均衡算法
/*官方文档明确给出了警告
        这个自定义配置类不能放在@ Componentscan所扫描的当前包下以及子包下
否则我们自定义的这个配置类就会被所有的 Ribbon?客户端所共享,也就是说
        我们达不到特殊化定制的目的*/
public class ConsumerApplication {
    public static void main(String[] args) {
        SpringApplication.run(ConsumerApplication.class,args);
    }
}
